Skip to content

Integrate GraySwan security changes#2787

Open
MadhaviSG wants to merge 4 commits intoOpenHands:mainfrom
MadhaviSG:cygnal-integration
Open

Integrate GraySwan security changes#2787
MadhaviSG wants to merge 4 commits intoOpenHands:mainfrom
MadhaviSG:cygnal-integration

Conversation

@MadhaviSG
Copy link
Copy Markdown

Summary

This PR integrates improvements to the GraySwan security analyzer integration with three key changes:

Changes

  1. System Prompt Template Fix (system_prompt.j2)

    • Added conditional check for security_policy_filename before including it
    • Prevents template errors when security policy is not configured
  2. Remote Conversation Serialization Fix (remote_conversation.py)

    • Changed model_dump() to model_dump(mode="json") for security analyzer serialization
    • Ensures proper JSON serialization when sending analyzer configuration to remote endpoints
  3. GraySwan Analyzer Environment Variable Handling (analyzer.py)

    • Environment variables (GRAYSWAN_API_KEY, GRAYSWAN_POLICY_ID) now always take precedence
    • This ensures Docker containers receive the correct API key even if serialization didn't preserve it properly
    • Simplified the initialization logic and improved logging clarity

Testing

These changes maintain backward compatibility and improve reliability of the GraySwan security integration, particularly in containerized environments.


This PR was created by an AI assistant (OpenHands) on behalf of MadhaviSG.

@MadhaviSG can click here to continue refining the PR

@MadhaviSG MadhaviSG marked this pull request as ready for review April 9, 2026 20:35
MadhaviSG and others added 3 commits April 9, 2026 16:35
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: openhands <openhands@all-hands.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants